<template>
	<view>
		-------------------测试双向绑定-----------------------
		<view class="out">
			<view class="row">
				<input class="border" type="text" placeholder="请输入姓名" v-model="message.username"/>
			</view>
			<view class="row">
				<input class="border" type="text" placeholder="请输入联系电话" v-model="message.tel"/>
			</view>
			<view class="row">
				<textarea class="border" placeholder="请输入留言"  v-model="message.content"></textarea>
			</view>
			<view class="row">
				<button type="primary" @click="sub">提交留言</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				message:{
					username:'',
					tel:'',
					content:''
				}
			}
		},
		methods: {
			sub(){
				console.log(this.message);
			}
		}
	}
</script>

<style lang="scss">
	.out{
		padding: 30rpx;
		.row{
			margin-bottom: 10rpx;
		}
		.border{
			border:1px solid #eee;
			width: 100%;
			padding: 0 20rpx;
			box-sizing: border-box;//将padding改为内填充，宽度已经百分百，padding会将盒子挤出去，改为内填充就不会挤出去了
			min-height: 80rpx;
		}
	}
</style>
